from db import mysql_engine
from sqlalchemy.sql import text

# 自动提交事务
with mysql_engine.begin() as conn:
    conn.execute(
        text("INSERT INTO some_table (x, y) VALUES (:x, :y)"),
        [{"x": 1, "y": 1}, {"x": 2, "y": 4}],
    )
